"use strict";
class Person {
    // 入参也必须写类型
    constructor(name, age) {
        this.name = name;
        this.age = age;
    }
    speak() {
        console.log(`${this.name}今年${this.age}岁`);
    }
}
class Student extends Person {
    constructor(name, age, grade) {
        super(name, age);
        this.grade = grade;
    }
    // override :复写父类方法，防止写错
    speak() {
        console.log(`${this.name}今年${this.age}岁,现在${this.grade}`);
    }
}
const s1 = new Student("小米", 12, "高三");
console.log(s1);
s1.speak();
